
#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>

void printf_AB32VG1_Board_IO_Info()
{
    rt_kprintf("\nAB32VG1_V2.0 Board IO Info\n");
    rt_kprintf("********************************\n");
    rt_kprintf("  AB32|IO| Ardiono |IO|AB32     \n");
    rt_kprintf("--------------------------------\n");
    rt_kprintf("  PA.3|%02d|RX     A5|%02d|PE.7  \n", rt_pin_get("PA.3"),rt_pin_get("PE.7"));
    rt_kprintf("  PA.4|%02d|TX     A4|%02d|PE.6  \n", rt_pin_get("PA.4"),rt_pin_get("PE.6"));
    rt_kprintf("  PF.1|%02d|D2     A3|%02d|PE.5  \n", rt_pin_get("PF.1"),rt_pin_get("PE.5"));
    rt_kprintf("  PB.0|%02d|D3     A2|%02d|PWKEY \n", rt_pin_get("PB.0"));
    rt_kprintf("  PA.5|%02d|D4     A1|%02d|PB.1  \n", rt_pin_get("PA.5"),rt_pin_get("PB.1"));
    rt_kprintf("  PE.1|%02d|D5     A0|%02d|PB.2  \n", rt_pin_get("PE.1"),rt_pin_get("PB.2"));
    rt_kprintf("  PE.0|%02d|D6                   \n", rt_pin_get("PE.0"));
    rt_kprintf("  PF.0|%02d|D7    VIN|VIN \n", rt_pin_get("PF.0"));
    rt_kprintf("                GND|GND   \n");
    rt_kprintf("       NC|D8    GND|GND \n");
    rt_kprintf("  PA.6|%02d|D9    GND|GND \n", rt_pin_get("PA.6"));
    rt_kprintf("  PE.4|%02d|D10   5V |5V  \n", rt_pin_get("PE.4"));
    rt_kprintf("  PA.1|%02d|D11   3.3|3.5 \n", rt_pin_get("PA.1"));
    rt_kprintf("  PA.2|%02d|D12   RST|NC  \n", rt_pin_get("PA.2"));
    rt_kprintf("  PA.0|%02d|D13   REF|REF \n", rt_pin_get("PA.0"));
    rt_kprintf("      GND|GND   NC |      \n");
    rt_kprintf("       NC|AREF            \n");
    rt_kprintf("  PE.2|%02d|SDA           \n", rt_pin_get("PE.2"));
    rt_kprintf("  PE.3|%02d|SCL           \n", rt_pin_get("PE.3"));
    rt_kprintf("********************************\n");
}

#ifdef FINSH_USING_MSH
MSH_CMD_EXPORT(printf_AB32VG1_Board_IO_Info, AB32VG1_V2.0 Board IO Info);
#endif